package cn.edu.cqvie.netty.thrift;

import org.apache.thrift.TException;
import thrift.genrated.DataException;
import thrift.genrated.Person;
import thrift.genrated.PersonService;

public class PersonServiceImpl implements PersonService.Iface {

    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("Got Client Param username =" +username);

        Person person = new Person();

        person.setName(username);
        person.setAge(23);
        person.setMarried(false);

        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {
        System.out.println("Got Clinet Param");
        System.out.println("Got Clinet Param username =" + person.name);
        System.out.println("Got Clinet Param age      =" + person.age);
        System.out.println("Got Clinet Param married  =" + person.married);

    }
}
